# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Marcin Kulik <marcin@asciinema.org>

pkgname=asciinema
pkgver=2.4.0
pkgrel=1
pkgdesc='Record and share terminal sessions'
arch=(any)
url='https://asciinema.org/'
license=(GPL3)
depends=(python)
makedepends=(git python-setuptools python-wheel python-build python-installer)
source=('git+https://github.com/asciinema/asciinema#commit=1a71be26c4c29e7cd98b97a11233cf3fb724ba9b') # tag: v2.4.0
b2sums=('SKIP')

prepare() {
  echo -e '#!/bin/sh\n/usr/bin/python -m asciinema "$@"' > "$pkgname/asciinema.sh"
}

build() {
  cd $pkgname
  python -m build --wheel --no-isolation
}

package() {
  cd $pkgname
  install -Dm755 -t "$pkgdir/usr/bin" asciinema.sh
  python -m installer --destdir="$pkgdir" dist/*.whl
}
